<%@ page import="com.example.login.model.User" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: 86156
  Date: 2022/3/15
  Time: 15:35
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>列表</title>
</head>
<body>
<table class="tab">
    <form action="delete" method="get">
        <tr>
            <td>id</td>
            <td>userName</td>
            <td>password</td>
        </tr>
        <%
            List<User> userList= (List<User>) request.getServletContext().getAttribute("userList");
            for (User user:userList) {
                Integer id = user.getId();
                String userName=user.getUserName();
                String password=user.getPassword();
        %>
        <tr>
            <td><%=id%></td>
            <td><%=userName%></td>
            <td><%=password%></td>
            <td><a href="delete?id=<%=id%>">删除</a></td>
        </tr>
        <%
            }
        %>
    </form>
</table>
</body>
</html>

